package com.burgeon.backend.SHOPBACKEND.controller;

import com.burgeon.backend.SHOPBACKEND.service.BackendBirthdayDeployService;
import com.burgeon.backend.stsutil.ResponseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@CrossOrigin
@RestController
@RequestMapping("backend/birthday")
public class BackendBirthdayDeployController extends BaseController {

    @Autowired
    private BackendBirthdayDeployService backendBirthdayDeployService;


    /**
     * @author: 伯俊软件
     * @description: 展示所有的积分商品及搜索
     * @date: 2021/7/28 14:59
     * @param account
     * @param flag：标识   K：款号   N ：名称
     * @param message：搜索内容
     * @return com.burgeon.backend.stsutil.ResponseResult<java.util.List<com.burgeon.backend.SHOPBACKEND.entity.Goods>>
     */
    @RequestMapping("findIntegralGoods")
    public ResponseResult<HashMap> findIntegralGoods(String account, String flag, String message){
        HashMap data = backendBirthdayDeployService.findIntegralGoods(account,flag,message);
        return new ResponseResult<HashMap>(SUCCESS,data);
    }

   /* *//**
     * @author: 伯俊软件
     * @description: 编辑
     * @date: 2021/7/28 16:16
     * @param account
     * @param goodId：商品ID
     * @return com.burgeon.backend.stsutil.ResponseResult<com.burgeon.backend.SHOPBACKEND.entity.Goods>
     *//*
    @RequestMapping("findGoodsData")
    public ResponseResult<Goods> findGoodsData(String account,String goodId){
        Goods data = backendBirthdayDeployService.findGoodsData(account,goodId);
        return new ResponseResult<Goods>(SUCCESS,data);
    }*/


    /**
     * @author: 伯俊软件
     * @description: 修改活动积分
     * @date: 2021/7/28 16:24
     * @param account
     * @param goodId：商品ID
     * @param activityIntegral：活动积分
     * @return com.burgeon.backend.stsutil.ResponseResult<java.lang.Void>
     */
    @RequestMapping("updateActivityIntegral")
    public ResponseResult<Void> updateActivityIntegral(String account, String goodId, String activityIntegral){
        backendBirthdayDeployService.updateActivityIntegral(account,goodId,activityIntegral);
        return new ResponseResult<Void>(SUCCESS);
    }

    /**
     * @author: 伯俊软件
     * @description: 显示/隐藏
     * @date: 2021/7/28 16:31
     * @param account
     * @param goodId：商品ID
     * @param isShow:是否显示 Y/N
     * @return com.burgeon.backend.stsutil.ResponseResult<java.lang.Void>
     */
    @RequestMapping("updateIsShow")
    public ResponseResult<Void> updateIsShow(String account, String goodId, String isShow){
        backendBirthdayDeployService.updateIsShow(account,goodId,isShow);
        return new ResponseResult<Void>(SUCCESS);
    }

    /**
     * @author: 伯俊软件
     * @description: 提交生日好礼配置
     * @date: 2021/7/28 16:59
     * @param token
     * @param couponTypeId：优惠券ID
     * @param isOpen：是否开启
     * @param getWay：领取方式 ： M：当月   QW：前一周  HW：后一周
     * @return com.burgeon.backend.stsutil.ResponseResult<java.lang.Void>
     */
    @RequestMapping("updateBirthdayConfiguration")
    public ResponseResult<Void> updateBirthdayConfiguration(String token, Integer couponTypeId, String isOpen, String getWay){
        backendBirthdayDeployService.updateBirthdayConfiguration(token,couponTypeId,isOpen,getWay);
        return new ResponseResult<Void>(SUCCESS);
    }

}
